﻿
//功能：移动聊天窗口
var chatWin_x = 0;
var chatWin_y = 0;//聊天窗口的left和top值
var chatWin_state = 1; //记录鼠标左键状态0:down   1:up
var TopWin = 0; //用于目标聊天窗口顶层显示
function MouseDown(source) {
    chatWin_state = 0;
    source.parentNode.style.zIndex = TopWin++; //目标窗口放到最上
    chatWin_x = event.offsetX;
    chatWin_y = event.offsetY;
}

function follow(source) {
    if (chatWin_state == 0) {
        source.parentNode.style.position = "absolute";
        source.parentNode.style.left = event.clientX - chatWin_x;
        source.parentNode.style.top = event.clientY - chatWin_y;
    }
}

function MouseUp(source) {
    chatWin_state = 1;
}
